RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

# Application Handler
RewriteRule ^([_A-Za-z0-9-]+)/?$ index.php?action=$1	[QSA,NC,L]
RewriteRule ^([_A-Za-z0-9-]+)[+]$ index.php?action=stats&id=$1	[QSA,NC,L]

# Admin Panel
RewriteRule ^admin/([_A-Za-z0-9-]+)/?$ admin/index.php?action=$1 [QSA,NC,L]

# Application 
RewriteRule ^([_A-Za-z0-9-]+)/([_A-Za-z0-9-]+)/?$ index.php?action=$1&do=$2 [QSA,NC,L]
RewriteRule ^sitemap.xml$ sitemap.php

ErrorDocument 404 /404.php